package com.sunday.common.mq.rabbit.study.spring.study.e3_Receiving_Messages;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Component;

import java.lang.annotation.*;

//@Component
public class MetaAnnotationTestBean {

    @MyListener("queue1")
    @MyListener("queue2")
    public void handleIt(String body) {
    }


    @RabbitListener
    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    @Repeatable(MyListeners.class)
    @interface MyListener {

        @AliasFor(annotation = RabbitListener.class, attribute = "queues")
        String[] value() default {};

    }

    @Target(ElementType.METHOD)
    @Retention(RetentionPolicy.RUNTIME)
    @interface MyListeners {

        MyListener[] value();

    }

}

